<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>JavaScript字符串</title>
  </head>
  <body>
    <script type="text/javascript">
      var carname='Volvo xc60';
      console.log(carname);
      var carname="Volvo xc60";
      console.log(carname);
      var character = carname[0];
      console.log(character);
      var answer = "It's right!";
      console.log(answer);
      var answer = "My name is 'tiger'";
      console.log(answer);
      var answer = 'My name is "tiger"';
      console.log(answer);
      var answer = 'My name is \'tiger\'';
      console.log(answer);
      console.log(answer.length);
      var string="I am String"
      console.log(typeof string);
      var object=new String("I am Object");
      console.log(typeof object);
    </script>
    <pre>
        var carname='Volvo xc60';
        console.log(carname);
        var carname="Volvo xc60";
        console.log(carname);
        var character = carname[0];
        console.log(character);
        var answer = "It's right!";
        console.log(answer);
        var answer = "My name is 'tiger'";
        console.log(answer);
        var answer = 'My name is "tiger"';
        console.log(answer);
        var answer = 'My name is \'tiger\'';
        console.log(answer);
        console.log(answer.length);
        var string="I am String"
        console.log(typeof string);
        var object=new String("I am Object");
        console.log(typeof object);
    </pre>

  </body>
</html>
